package cn.gcyl.module.biz.dal.mysql.usersubscriptionwordslog;

import java.util.*;

import cn.gcyl.framework.common.pojo.PageResult;
import cn.gcyl.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gcyl.framework.mybatis.core.mapper.BaseMapperX;
import cn.gcyl.module.biz.dal.dataobject.usersubscriptionwordslog.UserSubscriptionWordsLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gcyl.module.biz.controller.admin.usersubscriptionwordslog.vo.*;

/**
 * 用户订阅词记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserSubscriptionWordsLogMapper extends BaseMapperX<UserSubscriptionWordsLogDO> {

    default PageResult<UserSubscriptionWordsLogDO> selectPage(UserSubscriptionWordsLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserSubscriptionWordsLogDO>()
                .eqIfPresent(UserSubscriptionWordsLogDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserSubscriptionWordsLogDO::getSubscriptionWord, reqVO.getSubscriptionWord())
                .betweenIfPresent(UserSubscriptionWordsLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserSubscriptionWordsLogDO::getId));
    }

}